-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(extra-native-rdr3): GET_MINIMAP_TYPE
#3150
base: master
Are you sure you want to change the base?
feat(extra-native-rdr3): GET_MINIMAP_TYPE
#3150
Conversation
58a7a2a
to
d8dacab
Compare
just a note for the Cfx team if it helps, I was able to test this and works as intended @KadDarem can you please resolve the comments I made? it's now outdated so it doesnt confuse the team, just to make it easier for them to merge this. |
I tried to find another pattern to get this value to avoid the launcher crash when I use it outside the native handlers. I found the pointer valueon CE but his pattern doesn't work. So help is welcoming. It's the first time I work with pattern scanning, not easy |
The crash might be occurring because the pattern you're using to locate the address is probably dynamic |
GET_MINIMAP_TYPE
Do you have tips to find a better pattern ? |
I have tried to find it for a couple hours and @Ktos93 also helped , but we weren't able to find one |
I can give you the CE pointer I found if it can help you. |
Can you share here so other people can try to help? |
|
All of these pointers trigger the correct value of the minimap type. |
Nice, I'll try to help with that. |
I found a pattern like that, now we have to find the correct way to use it
this instruction is called every frame. |
I found a lot of interesting patterns from my CE pointers, but all crash my launcher if I put them outside the function with the error |
Hi, I find a function that return the minimap type, the function only receives the instance of the class that we already have declared above in a variable called static hook::cdecl_stub<uint32_t(void*)> g_uiMinimap_GetType([]()
{
return hook::get_call(hook::get_pattern("E8 ? ? ? ? 83 F8 ? 74 ? 48 8D 15"));
});
fx::ScriptEngine::RegisterNativeHandler("GET_MINIMAP_TYPE", [](fx::ScriptContext& context)
{
uint32_t minimapType = g_uiMinimap_GetType(g_uiMinimap);
context.SetResult<int>(minimapType);
}); |
Nice ! I will test that to check if it works in my side too. |
It works perfectly, thanks @DaniGP17 . Can you confirm this refactor resolves your request @outsider31000 ? |
Glad to hear that 😄 |
I will make spome tests you should squash the commits though @KadDarem |
I have made some tests and i have to clarify, that this native will only detect the type it has been set either by using the native for example: which makes sense. thats how it should work. for a detection of current type we would need another native perhaps like |
It's now perfectly possible with this new native.
PS : I also tested with the "Radar" prompts and the |
yeah this works as intended, just dont forget to squash the commits @KadDarem so it doesn't delay any revivews |
5b656b5
to
d8dacab
Compare
cb42f1c
to
333208a
Compare
Update HudNatives.cpp
333208a
to
9f06f31
Compare
Commits squashed. Thanks for your help everyone ;) |
Goal of this PR
Get the minimap type in RDR3
...
How is this PR achieving the goal
Return the value 0,1,2 or 3 depending on whether the map is off, standard, expended, or simple.
...
This PR applies to the following area(s)
RedM natives
...
Successfully tested on
Get the minimap type after edit it with SetMinimapType(): ✅
Get the minimap type after edit it in the pause menu: ✅
Game builds: 1491
Platforms: Windows
Checklist
Fixes issues
Fixed the missing native to get the minimap type set by SetMinimapType()